import { request }  from '@/axios/request'

//单个获取
export const GetOne = (parmas) => {
    return request({
        url: '/Administrative/Get',
        method: 'get',
        data: {"Id": parmas}
    })
}

// 列表查询接口
export const GetList = (parmas) => {
    return request({
        url: '/Administrative/EntityList',
        method: 'get',
        data: parmas
    });
}

//分页查询
export const GetListByPage = (parmas) => {
    return request({
        url: '/Administrative/ListByPage',
        method: 'get',
        data: parmas
    });
}

//查询省份
export const GetProvinceList = (parmas) => {
    return request({
        url: '/Administrative/ProvinceList',
        method: 'get',
        data: parmas
    });
}

//查询地级市
export const GetCityList = (parmas) => {
    return request({
        url: '/Administrative/CityList',
        method: 'get',
        data: { ProvinceCode : parmas} 
    });
}

//查询县级市
export const GetZoneList = (parmas) => {
    return request({
        url: '/Administrative/ZoneList',
        method: 'get',
        data: { CityCode: parmas } 
    });
}

export const Create = (parmas) => {
    //console.log('>>>>>>>>>AdministrativeAPICreate',parmas)
    return request({
        url: '/Administrative/Create',
        method: 'post',
        data: parmas
    })
}

export const DeleteSingle = (parmas) => {
    return request({
        url: '/Administrative/DeleteSingle',
        method: 'delete',
        data: { "Id": parmas }
    })
}

export const DeleteList = (parmas) => {
    return request({
        url: '/Administrative/DeleteList',
        method: 'post',
        data: JSON.stringify(parmas)
    })
}

//{ entity: this.Administrative, Id: this.Administrative.Id}
export const Update = (parmas) => {
    return request({
        url: '/Administrative/Update',
        method: 'put',
        data: { "entity": parmas,"Id": parmas.Id}
    })
}

